home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 176-200 / scopedisk180 / arexxtutorial / function_host / test.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  1KB  |  71 lines

  1. /* test.rexx */
  2.  
  3. /* Test the demo ARexx function host */
  4.  
  5. /* Written by Donald T. Meyer */
  6.  
  7.  
  8.  
  9. if show( Libraries, "DEMO_FUNC_HOST" ) ~= 1 then
  10.     do
  11.         say "Oops!  You must run   rh_demo   to install the function"
  12.         say "host before this ARexx test program can run!"
  13.         exit 20
  14.     end
  15.  
  16. say "First, a display beep:"
  17.  
  18. call dbeep()
  19.  
  20. say
  21.  
  22.  
  23.  
  24. say "Now a function which returns a string:"
  25.  
  26. say rats()
  27.  
  28. say
  29.  
  30.  
  31.  
  32. say "And a function which returns a boolean based upon the length"
  33. say "of the string passed to it:"
  34.  
  35. say bigword( "Hello" )
  36. say bigword( "aaabbbcccdddeeefffggg" )
  37.  
  38. say
  39.  
  40.  
  41.  
  42. say "A somewhat usefull function to return just the filename"
  43. say "from a fully-qualified  volume:path/filename"
  44. say
  45. name = "DF0:startrek"
  46. say "Calling with: " || name
  47. say "Returns: " || filename( name )
  48. say
  49.  
  50. name = "DF0:tests/startrek"
  51. say "Calling with: " || name
  52. say "Returns: " || filename( name )
  53. say
  54.  
  55.  
  56. say "And finally, a function which always returns an error:"
  57. say "(This will abort the ARexx program!)"
  58.  
  59. call myerror
  60.  
  61. /* We actually never get to here. */
  62.  
  63. say
  64.  
  65.  
  66.  
  67. say "All Done testing!!"
  68.  
  69. exit 0
  70.  
  71.